#include <iostream>
#include <cassert>
#include <vector>
#include <algorithm>
#include <sstream>
#include <list>
#include <stack>
#include <queue>
#include <map>
using namespace std;

// https://blog.csdn.net/u012028275/article/details/113822421


//支持正数
float MagicCubeRoot(float x)
{
    float xthird = 0.333f * x;
    int i = *(int*)&x;
    i = (0x2a517d47 + (0.333f * i));
    x = *(float*)&i;
    x = 0.667f * x + xthird / (x * x);
    x = 0.667f * x + xthird / (x * x); //牛顿迭代，用于提高精度
    
    return x;
}

int main(){
    cout<< MagicCubeRoot(8)<<endl;
    return 0;
}